const KoaRouter = require('@koa/router')
const { verifyAuthorization } = require('../middleware/login.middleware')
const { handleAvatar } = require('../middleware/file.middleware')
const fileController = require('../controller/file.controller')


const fileRouter = new KoaRouter({ prefix: '/file' })
// 上传数据
fileRouter.post('/avatar', verifyAuthorization, handleAvatar, fileController.createAvatar)
// 查看头像
fileRouter.get('/avatar/:id/:time', fileController.showAvatar)

module.exports = fileRouter